﻿var app = angular.module('stuApp', ['ngResource','ngCookies']);
app.config(['$locationProvider', function ($locationProvider) {
    $locationProvider.html5Mode({
        enabled: true,
        requireBase: false
    });
}]);
app.controller('successCtr', function ($scope, mainService, $location, $cookieStore) {
//加载
    $scope.init = function () {
        $scope.rate = $location.search().rate;
        $scope.time = $location.search().time;
        $scope.getCookie();
    }
    //cookie
    $scope.getCookie = function () {
        $scope.book_type_name = $cookieStore.get('bookTypeName');
        try {
            //获取用户信息
            $scope.userid = $cookieStore.get('loginInfo').empid;
            $scope.username = $cookieStore.get('loginInfo').name;
        }
        catch (e) {
            //获取用户信息失败则返回登录页面
            window.location.href = "../../../login.html";
        }
    }
    //再来一次
    $scope.again = function () {
        window.location.href = 'pass.html';
    }
    //查看解析
    $scope.view_parsing = function () {
        window.location.href = 'parse.html';
    }
    //挑战更难
    $scope.challenge = function () {

    }
    $scope.init();
})